<%@include file="/WEB-INF/views/includes/taglibs.jsp"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@include file="/WEB-INF/views/includes/adminHeader.jsp"%>



<!--[if gte IE 6]>
<script>
$(document).ready( function() {
$(".dataRow").mouseover(function(){$(this).addClass("dataRowOver");});
$(".dataRow").mouseout(function(){$(this).removeClass("dataRowOver");});
});
</script>
<![endif]-->
<script type="text/javascript">
function addNewGroup() {
	$('#newGroupDialog').dialog('open');
}
$(document).ready(
		function() {
			$('#newGroupDialog').dialog({
				autoOpen: false,
				width: 500,
				draggable : true,
				resizable : false,
				dialogClass : 'commonDialog',
				buttons: {
					"Ok": function() {
						$('#newActionerGroupform').submit();
					},
					"Cancel": function() {
						$(this).dialog("close");
					}
				}
			});
		});
</script>
<div title="Add new Display Group" id="newGroupDialog">
	<h3>Add new Display Group</h3>
	<form:form method="post" action="addActionGroup" id="newActionerGroupform">
		<input type="hidden" name="bizsysId" value="${selectedBizSystem.id}" id="bizsysId"/>
		<div style="font-size:12px;margin-bottom:10px"><span class="label" style="width:100px">Group Name:</span><span><form:input path="defaultDisplayName"/></span></div>
		<div style="font-size:12px;margin-bottom:10px"><span class="label" style="width:100px;vertical-align:top">Description:</span><span><form:textarea path="description" style="width:250px"/></span></div>
	</form:form>
	<br/>
</div>
<div class="homePage ui-tabs-panel ui-widget-content ui-corner-bottom">
	<div id="leftMenu">
		<%@include file="/WEB-INF/views/includes/functionAdminLeftNav.jsp"%>
	</div>
	<div id="rightContent">
		<%@include file="/WEB-INF/views/includes/messages.jsp"%>
		<h2>Actioner Groups of <font style="color:#2e6e9e">${selectedBizSystem.name}</font> <a href="<c:url value='/web/actionerGroupList'/>">Change Business System</a></h2>
		<div class="searchBlock">
				<button type="button"
						class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
						onclick="addNewGroup()" style="margin-top:5px">
						<span class="ui-button-text">Add new Group</span>
				</button>
				<br/><br/>
		</div>
		<div>
			<table class="generaltable" style="width:100%" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<th>Group Name</th>
						<th>Description</th>
						<th>Operation</th>
					</tr>
				</thead>
				<tbody>
				<c:if test="${not empty actionerGroupList}">
					<c:forEach items="${actionerGroupList}" var="oneGroup">
					<tr class="dataRow">
						<td>${oneGroup.defaultDisplayName}</td>
						<td>${oneGroup.description}</td>
						<td>
							<a href="#" onclick="editGroup('${oneGroup.id}')">Edit</a>		
						</td>
					</tr>
					</c:forEach>
				</c:if>
				</tbody>
			</table>
		</div>
		<div style="height:1px;width:740px;"></div>
	</div>
</div>

<%@include file="/WEB-INF/views/includes/adminfooter.jsp"%>